package work20241125;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/25
 */
public class Demo10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个圆的半径:");
        double r = sc.nextDouble();
        String str = area(r);
        System.out.println(str);
    }

    //7、写程序输出一个圆的面积；
    public static String area(double r) {
        return "半径为" + r + "的圆的面积为:" + 3.14 * r * r;
    }
}
